/// <reference path="Bindings.ts" />
/// <reference path="CustomXmlParts.ts" />
/// <reference path="Settings.ts" />
/// <reference path="AsyncResult.ts" />

/// <reference path="Enumerations\DocumentMode.ts" />
/// <reference path="Enumerations\EventType.ts" />
/// <reference path="Enumerations\FileType.ts" />
/// <reference path="Enumerations\CoercionType.ts" />

declare module Microsoft.Office.WebExtension {

    /** An abstract class that represents the document the app is interacting with. */
    export class Document {
        /** Gets an object that provides access to the bindings defined in the document. */
        bindings: Microsoft.Office.WebExtension.Bindings;
        /** Gets an object that represents the custom XML parts in the document. */
        customXmlParts: Microsoft.Office.WebExtension.CustomXmlParts;
        /** Gets the mode the document is in. */
        mode: Microsoft.Office.WebExtension.DocumentMode;
        /** Gets the URL of the document that the host application currently has open. */
        url: string;
        /** Gets an object that represents the saved custom settings of the content or task pane app for the current document. */
        settings: Microsoft.Office.WebExtension.Settings;

        /** Adds an event handler for a Document object event. */
        addHandlerAsync: (eventType: Microsoft.Office.WebExtension.EventType, handler?: any, options?: { asyncContext?: any; }, callback?: (result: AsyncResult) => void) => void;
        /** Returns the entire document file in slices of up to 4194304 bytes (4MB). */
        getFileAsync: (fileType: Microsoft.Office.WebExtension.FileType, options?: { sliceSize?: number; asyncContext?: any; }, callback?: (result: AsyncResult) => void) => void;
        /** Reads the data contained in the current selection of the document. */
        getSelectedDataAsync: (coercionType: Microsoft.Office.WebExtension.CoercionType, options?: { valueFormat?: ValueFormat; filterType?: FilterType; asyncContext?: any; }, callback?: (result: AsyncResult) => void) => void;
        /** Removes an event handler for a Document object event. */
        removeHandlerAsync: (eventType: Microsoft.Office.WebExtension.EventType, options?: { handler?: any; asyncContext?: any; }, callback?: (result: AsyncResult) => void) => void;
        /** Writes data to the current selection in the document. */
        setSelectedDataAsync: (data: any, options?: { coercionType?: CoercionType; asyncContext?: any; }, callback?: (result: AsyncResult) => void) => void;
    }
}